using System;
using System.Collections.Generic;
using System.Text;

namespace DDW
{
	public class UsingDirectiveNode : BaseNode
	{
		private bool isAlias = false;
		
		private IdentifierExpression target;
		public IdentifierExpression Target
		{
			get { return target; }
			set { target = value; }
		}

		private IdentifierExpression aliasName;
		public IdentifierExpression AliasName
		{
			get { return aliasName; }
			set { aliasName = value; isAlias = true; }
		}
		public bool IsAlias
		{
			get { return isAlias; }
        }

        public override void ToSource(StringBuilder sb)
        {
			sb.Append("using ");

			// target
			target.ToSource(sb);

			if (IsAlias)
			{
				sb.Append(" = ");
				aliasName.ToSource(sb);
			}
			sb.Append(";");
			this.NewLine(sb);
        }
	}
}
